import { defineStore } from "pinia";

export const useUserStore = defineStore("user", {
    state: () => ({
        userinfo: {} as any
    }),
    getters: {
        isLogin(store) {
            return Object.keys(store.userinfo).length > 0 ? true : false;
        }
    },
    actions: {
        logout() {
            this.userinfo = {} as any;
        }
    }
});
